package com.spring.springv2;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;

/**
 * @Description
 * @Author zhoucq
 * @Date 2025/9/17 20:43
 * @Version 1.0
 * spring 2.x
 * 在 sping-service.xml 文件中 添加 开启注解驱动：
 * <context:component-scan base-package="com.springv2"></context:component-scan>
 *
 */
public class SpringV2 {
    public static void main(String[] args) {
        ApplicationContext context =
                new FileSystemXmlApplicationContext(new String[]{"classpath:spring/spring-service.xml"});
        //sping会解析这个配置文件，创建对象，并放入IOC容器中
        TestService dataSource = context.getBean(TestService.class);
        System.out.println(dataSource);
    }
}
